﻿namespace Blaze.Framework
{
    using UnityEngine;

    /// <summary>
    /// 用于保存<see cref="AnimationCurve"/>资源。
    /// </summary>
    public class AnimationCurveAsset : ScriptableObject
    {
        public AnimationCurve curve = AnimationCurve.Linear(0, 0, 1, 1);

        public static implicit operator AnimationCurve(AnimationCurveAsset asset)
        {
            return asset.curve;
        }

        public static implicit operator AnimationCurveAsset(AnimationCurve curve)
        {
            var asset = CreateInstance<AnimationCurveAsset>();
            asset.curve = curve;
            return asset;
        }
    }
}